import request from '@/utils/request'
export function getCodeList (data) {
  return request({
    url: '/fawkes-code/v1/meta-code/code/list',
    method: 'get',
    params: data
  })
}
//创建元码
export function addCode (data) {
  return request({
    // url: '/fawkes-code/v1/meta-code',
    url: '/fawkes-code/v1/meta-code/value',
    method: 'post',
    data: data
  })
}
//创建有限码
export function addFiniteCode (data) {
  return request({
    url: '/fawkes-code/v1/meta-code',
    method: 'post',
    data: data
  })
}
//编辑元码
export function editCode (data) {
  return request({
    // url: `/fawkes-code/v1/meta-code/${id}`,
    url: '/fawkes-code/v1/meta-code/value',
    method: 'put',
    data: data
  })
}
//删除元码
export function deleteCode (id) {
  return request({
    url: `/fawkes-code/v1/meta-code/${id}`,
    method: 'delete'
  })
}

//获取字典值
export function getDicValue (data) {
  return request({
    url: '/fawkes-code/v1/dict-value/info',
    method: 'get',
    params: data
  })
}

// 获取对象列表
export function getObjList (data) {
  return request({
    url: '/fawkes-code/v1/objs',
    method: 'get',
    params: data
  })
}
// 获取元码分类
export function getAllCodeDetail () {
  return request({
    url: '/fawkes-code/v1/meta-code/value/all',
    method: 'get'
  })
}
//配置编码
export function enableRule (data) {
  return request({
    url: '/fawkes-code/v1/encode-model/config-model-encode',
    method: 'post',
    data: data
  })
}
//暂存配置编码
export function saveDraftRule (data) {
  return request({
    url: '/fawkes-code/v1/encode-model/config-model-encode',
    method: 'post',
    data: data
  })
}
//编辑模型编码启用状态
export function changeStatus (data) {
  return request({
    url: '/fawkes-code/v1/encode-model/change-enable-status',
    method: 'post',
    data: data
  })
}
// 模型编码详情
export function getModelEncode (data) {
  return request({
    url: '/fawkes-code/v1/encode-model/model-encode',
    method: 'get',
    params: data
  })
}
//编辑模型编码
export function changeModelRule (data) {
  return request({
    url: '/fawkes-code/v1/encode-model/edit-model-encode',
    method: 'put',
    data: data
  })
}